using System;
using System.Runtime.Serialization;

namespace FireStarter.CodeGeneration
{
    public class ReferenceMissingException: Exception
    {
        private readonly string _referenceName;

        public ReferenceMissingException(string referenceName)
        {
            _referenceName = referenceName;
        }

        public ReferenceMissingException(string referenceName, string message) : base(message)
        {
            _referenceName = referenceName;
        }

        public ReferenceMissingException(string referenceName, string message, Exception innerException) : base(message, innerException)
        {
            _referenceName = referenceName;
        }

        protected ReferenceMissingException(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            _referenceName = info.GetString("ReferenceName");
        }

        public string ReferenceName
        {
            get { return _referenceName; }
        }
    }
}